<template>
    <div id="NavAside">
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo">
      <el-submenu :index='index' v-for="(item,index,key) in allmenus" :key='key'>
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>{{item.permissionDesc}}</span>
        </template>
          <el-menu-item v-for="(permission,index2) in item.children" :index="index+'-'+index2" :key='index2' @click="shouView({name:permission.permissionDesc})">
              {{permission.permissionDesc}}
            </el-menu-item>
      </el-submenu>
    </el-menu>
    </div>
</template>
<script>
export default {
    data(){
        return {
        }
    },
     methods: {
         openss(){
             console.log(this.key)
         }
    },
    mounted(){
        var menus = JSON.parse(localStorage.getItem('response')).permissions
        this.$store.commit('ALLMENUS',menus)
    },
    computed:{
        allmenus(){
            return this.$store.getters.allmenus;
        }
    }
}
</script>
<style lang="scss" scoped>

</style>
